<?php
 
if (!defined('BASEPATH'))
exit('No direct script access allowed');
 ini_set("memory_limit", "64M");
//function pdf_create($html, $filename = '', $stream = TRUE, $papersize, $orientation )
function pdf_create($html, $filename, $stream=TRUE, $orientation="portrait") {

require_once("dompdf/dompdf_config.inc.php");
 
$dompdf = new DOMPDF();
$dompdf->load_html($html);
//$dompdf->set_paper("a4", "landscape");
$dompdf->set_paper("a4", $orientation);
$dompdf->render();
if ($stream) {
$dompdf->stream($filename . ".pdf");
} else {
return $dompdf->output();
}
}